package catgory;

/**
 * describe: 视频源类型枚举
 *
 * @author huxingjie
 * @date 2019/11/19
 * @since 4.0
 */
public enum VideoResourceTypeEnum {
    DIRECTCAMERA(1, "直连摄像机"),
    PLATFORMCAMERA(2, "平台接入摄像机"),
    DIRECTCAPTURE(3, "直连抓拍机"),
    PLATFORMCAPTURE(4, "平台接入抓拍机");

    private Integer type;

    private String name;

    VideoResourceTypeEnum(Integer type, String name) {
        this.type = type;
        this.name = name;
    }

    public static VideoResourceTypeEnum fromType(Integer type) {
        VideoResourceTypeEnum[] arrs = VideoResourceTypeEnum.values();
        for (VideoResourceTypeEnum info : arrs) {
            Integer index = info.getType();
            if (index == type) {
                return info;
            }
        }
        return null;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}

    